package cn.jbolt.ai.demo.controller;


import cn.jbolt.ai.demo.service.DemoService;
import cn.jbolt.ai.demo.vo.DimensionDemoVO;
import cn.jbolt.util.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * demo
 */
@Controller
@ResponseBody
@RequestMapping("/demo")
@Tag(name = "demo配置controller")
public class DemoController {

    @Autowired
    private DemoService demoService;

    @Operation(summary = "向量化演示", description = "text:向量化所需的文本,embeddingResourceId:资源id")
    @PostMapping("/dimensionDemo")
    public Result dimensionDemo(@RequestBody DimensionDemoVO vo) {

        return demoService.embeddingDemo(vo);
    }
    @Operation(summary = "文档提取演示", description = "url:地址")
    @GetMapping("/docParseDemo")
    public Result docParseDemo(String url) {

        return demoService.docParseDemo(url);
    }


    @Operation(summary = "文档分割演示", description = "url:地址,chunkSize:分块大小,chunkOverlap:重叠大小")
    @GetMapping("/docSplitDemo")
    public Result docSplitDemo(String url,Integer chunkSize, Integer chunkOverlap) {

        return demoService.docSplitDemo(url,chunkSize,chunkOverlap);
    }





}
